home *** CD-ROM | disk | FTP | other *** search
Java Source | 1995-12-31 | 1.4 KB | 57 lines |
- package brothers;
-
- // ------------------ The Dad Class ----------------- //
- private class Dad {
-
- private boolean sportscar;
- boolean fishing_boat; // default
- protected boolean golf_clubs;
- public boolean lawnmower;
-
- private protected boolean familycar;
- // SAME! protected private boolean xx;
-
- // public protected boolean pubprot;
- protected public boolean pubprot;
-
- // public private boolean pubprot;
- // private public boolean pubprot;
-
- // private public protected boolean pubprot;
- // public private protected boolean pubprot;
- // private protected public boolean pubprot;
- // public protected private boolean pubprot;
- // protected public private boolean pubprot;
- // protected private public boolean pubprot;
-
-
- public Dad() {
-
- // Dad can access everything, after all it is
- // his stuff (i.e. declared in his class)
-
- pubprot =true;
-
- sportscar = true;
- fishing_boat = true;
- golf_clubs = true;
- familycar = true;
- lawnmower = true;
- }
- }
-
-
- class lilbrother extends Dad {
-
- public lilbrother() {
- // sportscar = true; // ERROR! Dad only!
- fishing_boat = true; // ERROR! Dad and UncleFrank only!
- golf_clubs = true; // Ok, but be careful
- familycar = true; // Son can borrow
- lawnmower = true; // Yeah, sure anybody
-
- pubprot=true;
- }
-
- }
-